package com.drcoffee.drcoffeemall.controller;

import com.drcoffee.drcoffeemall.entry.CssOrientation;
import com.drcoffee.drcoffeemall.entry.Explosion;
import com.drcoffee.drcoffeemall.entry.Machine;
import com.drcoffee.drcoffeemall.service.ExplosionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * 爆炸图
 *
 * @author ShiHao Zhou
 */
@RestController
@RequestMapping("/explosion")
public class ExplosionController {

    @Autowired
    ExplosionService explosionService;

    /*
     * 根据机器ID查询爆炸图
     * */
    @GetMapping("/getExplosionByMachineId")
    public ResponseEntity<Object> getExplosionByMachineId(@RequestParam Integer machine_id) {
        return explosionService.getExplosionByMachineId(machine_id);
    }

    /*
     * 根ID查询爆炸图
     * */
    @GetMapping("/getExplosionById")
    public Map<String, Object> getExplosionById(@RequestParam Integer id) {
        return explosionService.getExplosionById(id);
    }

    /*
     * 查询关联的定位点
     * */
    @GetMapping("/getCssOrientation")
    public Map<String, Object> getCssOrientation(@RequestParam Integer id) {
        return explosionService.getCssOrientation(id);
    }
}
